#! /bin/bash 

BEGIN {
    printf "GOODS\tCOUNTS\n";
    sum=0;
}

{
    printf "%s\n",$0;
    sum+=$2;
}

END {
    printf "sum=%d\n",sum
}
